package cn.whitecao.agent.server.service.impl;

import cn.whitecao.agent.server.model.CollectDataModel;
import cn.whitecao.agent.server.service.DataCenterService;
import cn.whitecao.agent.server.service.SpanService;
import cn.whitecao.agent.server.service.impl.mysql.MysqlSpanServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;

/**
 * @author : BashfulHuang
 **/
@Service
public class DataCenterServiceImpl implements DataCenterService {

    @Autowired
    SpanService spanService;
    /**
     * 单条保存
     *
     * @param collectDataModel 收集的数据
     */
    @Override
    public void save(CollectDataModel collectDataModel) {

    }

    /**
     * 批量保存数据
     *
     * @param collectDataModels 收集的数据
     */
    @Override
    public void batchSave(Collection<CollectDataModel> collectDataModels) {
        spanService.batchSave(collectDataModels);
    }

    /**
     * 查询
     *
     * @param type      null不指定
     * @param startTime 开始时间戳
     * @param endTime   结束时间戳
     * @param traceId   traceId
     * @return list
     */
    @Override
    public List<CollectDataModel> query(Integer type, Long startTime, Long endTime, String traceId) {
        return null;
    }
}
